﻿<!DOCTYPE html>

<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <title></title>
</head>
<body>
    <script>
        // Set 类似于数组的一个数据类型 
        // 自带去重功能
        var ss = new Set([12, 23, 34, 23, 1, 2, 12]);
        console.log(ss);
        console.log(ss.size);

        var arr = [12, 23, 34, 23, 1, 2, 12];
        ss = new Set(arr);
        // console.log(ss);
        var arr1 = Array.from(ss);
        console.log(arr1);


        // 类似于对象的一中数据类型
        var mm = new Map([["name", "lili"], ["age", "18"]]);
        console.log(mm);
        mm.set("sex", true);
        // mm.set(arr,true);
        console.log(mm);
        console.log(mm.get("name"));
    </script>
</body>
</html>